package org.example.easybuy.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.easybuy.entity.Category;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Mapper
@Component
public interface CategoryDao {
    List<Category> selectByPage(Map<String,Object> params);

    List<Category> selectByType(int type);

    List<Category> selectListById(int id);

    Category checkCateName(Map<String,Object> params);

    int addCategory(Map<String,Object> params);

    Category getUpdateCategory(@Param("id")String id,@Param("type")int type);

    int selectCateCount(@Param("type")int type,@Param("id")int id);

    int deleteCate(int id);

    int updateCategory(Map<String,Object> map);

    int selectTypeById(int id);
}
